//
//  AboutViewController.m
//  Color
//
//  Created by ss on 14-7-25.
//  Copyright (c) 2014年 ss. All rights reserved.
//

#import "AboutViewController.h"
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#import "MobClick.h"
@interface AboutViewController ()
{

    UIImageView *imageViw;
    UILabel *versionLabel;
}
@end

@implementation AboutViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    [MobClick event:@"2013"];
    // Do any additional setup after loading the view.
    [self.navigationController setNavigationBarHidden:YES animated:YES];
    UITapGestureRecognizer *tap=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(backLastPage)];
    imageViw = [[UIImageView alloc]initWithFrame:self.view.frame];
    [self.view addSubview:imageViw];
    imageViw.userInteractionEnabled = YES;
    [imageViw addGestureRecognizer:tap];
    NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
    NSArray *launchImages = infoDictionary[@"UILaunchImages"];
    NSString *cImageSize = NSStringFromCGSize([UIScreen mainScreen].bounds.size);
    for (NSDictionary *dict in launchImages) {
        NSString *imageSize = dict[@"UILaunchImageSize"];
        if ([imageSize isEqualToString:cImageSize]) {
            NSLog(@"%@",dict[@"UILaunchImageName"]);
            imageViw.image=[UIImage imageNamed:dict[@"UILaunchImageName"]];
            break;
        }
        
    }
    versionLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 200, 20)];
    versionLabel.font = [UIFont systemFontOfSize:11];
    versionLabel.textColor = [UIColor whiteColor];
    versionLabel.backgroundColor = [UIColor lightGrayColor];
    versionLabel.textAlignment = NSTextAlignmentCenter;
    NSString *currentAppVersion = infoDictionary[@"CFBundleShortVersionString"];
    versionLabel.text=[NSString stringWithFormat:@" 版本: %@   ",currentAppVersion];
    [self.view addSubview:versionLabel];
    [versionLabel sizeToFit];
    
}
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    versionLabel.center = CGPointMake(self.view.center.x, self.view.frame.size.height-150);
}
-(void)backLastPage
{   [self.navigationController setNavigationBarHidden:NO animated:YES];
    [self.navigationController popViewControllerAnimated:YES];
    
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
